﻿<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>
        {if condition="$communityDetails.community_name == ''"}
        暂无
        {else/}
        {$communityDetails.community_name}
        {/if}
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" />
    <meta name="msapplication-TileColor" content="#090a0a">
    <link rel="stylesheet" href="__ROOT__/static/home/css/css_style.css">
    <script type="text/javascript" src="__ROOT__/static/plugins/jquery-3.2.1/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="__ROOT__/static/plugins/lazyload/jquery.lazyload.min.js"></script>
    <script type="text/javascript" src="__ROOT__/static/plugins/layer.mobile-v2.0/layer_mobile/layer.js"></script>
</head>
<body class="grayBy">
<div class="search_community_header">
    <a href="{:url('home/Community/index')}"><span class="category_community"><img style="width: 10px;height: 20px;" src="__ROOT__/static/home/css/myorder/images/back.png"/></span></a>
    <span class="search_topics">
        {if condition="$communityDetails.community_name == ''"}
            暂无
        {else/}
            {$communityDetails.community_name}
        {/if}
    </span>
    <a href="{:url('home/Topics/detailsInfo', array('id' => $communityDetails.id))}"><span class="search_topics_icon">写话题</span></a>
</div>
<ul class="address_list">
    {volist name='topics' id='vo'}
    <li>
        <a href="{:url('home/Topicnews/getTopicDetails',array('id'=> $vo.id,'community_id' => $communityDetails.id))}">
            <p><b><span>标题：</span>{$vo.title}</b></p>
            <div style="width: 100%">
                <img style="width: 100%" class="lazy" data-original="__ROOT__{$vo.topic_url}" src="__ROOT__/static/plugins/lazyload/grey.gif" alt="暂无图片" />
            </div>
            <p class="topics_content"><span>内容：</span>{$vo.topic_content}</p>
        </a>
        <div class="addr_op">
            <span>发表时间：</span><span>{:date("Y-m-d H:i", $vo.report_time)}</span>
            <br>
            <span>回复数：</span><span>{$vo.topicCommentDetailsCount}</span>
            {if condition="$user_id == $vo.user_id"}
            <em class="del"><i class="del_icon" id="{$vo.id}"></i>删除</em>
            {/if}
        </div>
    </li>
    {/volist}
</ul>
<div style="height: 70px;"></div>
<div class="footer_fixed clearfix">
    <span><a href="{:url('home/Community/index')}" class="aon"><i class="home_icon"></i><b>社区</b></a></span>
    <span><a href="{:url('home/Babyhome/index')}"><i class="customer_community_icon"></i><b>专题</b></a></span>
    <span><a href="{:url('home/Parenting/index')}"><i class="store_community_icon"></i><b>育儿</b></a></span>
    <span><a href="{:url('home/Activity/index')}"><i class="carts_community_icon"></i><b>活动</b></a></span>
</div>
</body>
</html>
<script type="text/javascript">
    /*图片懒加载*/
    $(function() {
        $("img.lazy").lazyload({effect: "fadeIn"});
    });

    /*删除话题*/
    $(".del").click(function () {
        var data = {};
        data.id = $('.del_icon').attr('id');
        layer.open({
            content: '确定删除吗？'
            ,btn: ['确定', '取消']
            ,skin: 'footer'
            ,yes: function(){
                $.post("{:url('home/Topics/topicDel')}", data, function(callback){
                    if(callback > 0){
                        layer.open({
                            content: '删除成功！'
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                        setTimeout('location.href = "{:url(\'home/Topics/TopicDetails\',array(\'id\'=> $communityDetails.id))}"', 500);
                    }else {
                        layer.open({
                            content: '删除失败！'
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                    }
                });
            }
        });
    });
</script>